<html>
<script>
window.onload = function() {
  window.setTimeout(function() {
    document.getElementById("anchor").href = "http://www.google.com";
  }, 2000);

  window.setTimeout(function() {
    var div = document.createElement("div");
    div.innerHTML = "div_inner";
    document.body.appendChild(div);
  }, 2000);

  window.setTimeout(function() {
    document.body.removeChild(document.querySelector("img"));
  }, 2000);
}
</script>
<a id="anchor"></a>
<img width=100 height=100>
</html>
